<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 100px;
            height: 100px;
            background: red;
            position: absolute;
            left: 0;
        }
    </style>
</head>
<body>
    <div class="box"></div>
</body>
<script src="./js/utils.js"></script>
<script>
    let box = document.querySelector('.box'); 
    move(box,'height',800);
    function move(ele,attr,target){
        let speed = 0;
        let timer = setInterval(() => {
            var width = parseInt(getStyle(ele,attr));
            speed = Math.ceil((target - width) / 5);
            width = width + speed;
            if(width === target){
                clearInterval(timer)
            }
            ele.style[attr] = width + 'px'
        },100)
    }
</script>
    
</html>